/**
 * <p>Copyright:Copyright(c) 2019</p>
 * <p>Company:Professional</p>
 * <p>Package:com.cesgroup.zw.spring.boot.echarts.scatter</p>
 * <p>File:SimpleScatterParam.java</p>
 * <p>类更新历史信息</p>
 * @todo chanlong(陈龙) 创建于 Jun 10, 2019 2:54:25 PM
 */
package com.cesgroup.zw.spring.boot.library.echarts.scatter.simple;

import java.util.LinkedHashMap;
import java.util.Map;

import com.cesgroup.zw.spring.boot.charts.model.IChartsParam;
import com.cesgroup.zw.spring.boot.charts.model.IComponent;
import com.cesgroup.zw.spring.boot.supports.consts.ChartsConst;

import lombok.Builder;
import lombok.Data;

/**
 * <p>描述: </p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date Jun 10, 2019 2:54:25 PM
 * @version 1.0.2019
 */
@Data @Builder @SuppressWarnings("serial")
public class SimpleScatterParam implements IChartsParam<SimpleScatterSeries, Map<Object, Object>> {
	
	private String[] categories;
	
	private Map<Object, Object> dataset;
	
	@Override
	public IComponent[] getSeries() {
		IComponent[] scatters = getSeries(SimpleScatterSeries.class, dataset.size());
		mergeDataset();
		return scatters;
	}
	
	private void mergeDataset() {
		Map<Object, Object> map = new LinkedHashMap<>();
		map.put(ChartsConst.KEY_OF_CATEGORIES, categories);
		map.putAll(dataset);
		this.dataset = map;
	}
}
